import { request } from '@/utils/request.js'
import { appConfig } from '@/config/config.js'

// 获取当前登录用户
export function getUser () {
  return request.get(appConfig.WEB_API + '/user/get')  
}

// 根据用户ID获取用户
export function getUserById (userId) {
  return request.get(appConfig.WEB_API + '/user/get/' + userId)  
}

// 用户头像修改
export function changeAvatar (params) {
  return request.put(appConfig.WEB_API + '/user/changeAvatar', params)  
}

// 用户信息修改
export function edit (params) {
  return request.put(appConfig.WEB_API + '/user/edit', params)  
}

// 获取用户收货地址
export function getAddress () {
  return request.get(appConfig.WEB_API + '/user/getAddress')
}
